<?php


namespace app\user\controller;


use app\index\controller\Base;
use app\user\model\Unit as Model;
use app\index\service\QrcodeServer;
use app\user\model\User as UserModel;
class Unit extends Base
{
    public function get(){
        $res = new Model();
        $data=$this->request->param();
        $d=$res->where($data['field'],$data['op'],$data['value'])
            ->select();
        return $d;
    }
    public function update()
    {
        $data = $this->request->param();
        $res = new Model();
        return $res->updateModel($data);
    }
    public function delete(){
        $data = $this->request->param();
        $res = new Model();
        return $res->deleteModel($data);
    }
    public function save(){
        $res = new Model();
        $data = $this->request->param();
        $d= $res->saveModel($data);
        return $d->er_id;
    }
    public function num(){
        $data = $this->request->param();
        $res =new Model();
        return $res->where($data['field'],$data['op'],$data['value'])->count();
    }

}